package thread;

public class Rabbit extends Thread{

	@Override
	public void run() {
		for(int i = 0 ; i<= 1000; i += 100) {
			System.out.println("兔子在" + i + "米");
			
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			if (i == 900) {
				System.out.println("兔子睡了...");
				try {
					Thread.sleep(Integer.MAX_VALUE);
				} catch (InterruptedException e) {
					System.out.println("兔子醒了继续跑");
				}
			}
		}
		System.out.println("兔子到终点");
	}
}
